#include <iostream>
using namespace std;
int main()
{
    char data_1[1001],data_2[10001];
    int num[1001],n,i,j;
    cin>>n;
    for (i=1;i<=n;i++)
    {
        int w,t=0;
        cin>>data_1>>data_2;
        cout<<"Case "<<i<<":"<<endl;
        cout<<data_1<<" + "<<data_2<<" = ";
        memset(num,0,sizeof(num));
        for (j=strlen(data_1)-1;j>=0;j--)num[t++]=data_1[j]-'0';
        t=0;
        for (j=strlen(data_2)-1;j>=0;j--)
        {
            num[t]=num[t]+data_2[j]-'0';
            t++;
        }
        w=strlen(data_1);
        if (w<strlen(data_2))w=strlen(data_2);
        for (j=0;j<w;j++)
            if (num[j]>=10)
            {
                num[j+1]+=num[j]/10;
                num[j]%=10;
                if (j==w-1)w++;
            }
        for (j=w-1;j>=0;j--)cout<<num[j];
        cout<<endl;
        if (i!=n)cout<<endl;
    }
    return 0;
}